//package com.ruyuan.eshop.construction.dao;
//
//import com.ruyuan.eshop.common.dao.BaseDAO;
//import com.ruyuan.eshop.construction.converter.AttributeConverter;
//import com.ruyuan.eshop.construction.domain.entity.AttributeValueDO;
//import com.ruyuan.eshop.construction.domain.request.AttributeRequest;
//import com.ruyuan.eshop.construction.mapper.AttributeValueMapper;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Repository;
//
//import javax.annotation.Resource;
//import java.util.List;
//
///**
// * 属性扩展
// *
// * @author zhonghuashishan
// */
//@Repository
//@Slf4j
//public class AttributeValueDAO extends BaseDAO<AttributeValueMapper, AttributeValueDO> {
//
//    @Resource
//    private AttributeConverter attributeConverter;
//
//    public Boolean saveOrUpdate(AttributeRequest attributeRequest) {
//        return this.saveOrUpdateBatch(buildAttributeValue(attributeRequest));
//    }
//
//
//    /**
//     * 构建规格值信息
//     *
//     * @param attributeRequest
//     * @return java.util.List<com.ruyuan.eshop.construction.domain.entity.AttributeValueDO>
//     * @author zhonghuashishan
//     */
//    private List<AttributeValueDO> buildAttributeValue(AttributeRequest attributeRequest) {
//        List<AttributeValueDO> attributeValueDOS =
//                attributeConverter.converterValueDOList(attributeRequest.getAttributeValueRequests());
//        for (AttributeValueDO attributeValueDO : attributeValueDOS) {
//            attributeValueDO.setUpdateUser(attributeRequest.getOperateUser());
//            // 初始化部分信息
//            attributeValueDO.initCommon();
//        }
//        return attributeValueDOS;
//    }
//
//}
